<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1" xml:lang="en">
  <title id="gz143896">pg_partition</title>
  <body>
    <p>The <codeph>pg_partition</codeph> system catalog table is used to track partitioned tables
      and their inheritance level relationships. Each row of <codeph>pg_partition</codeph>
      represents either the level of a partitioned table in the partition hierarchy, or a
      subpartition template description. The value of the attribute <codeph>paristemplate</codeph>
      determines what a particular row represents.</p>
    <table id="gz143898">
      <title>pg_catalog.pg_partition</title>
      <tgroup cols="4">
        <colspec colnum="1" colname="col1" colwidth="131pt"/>
        <colspec colnum="2" colname="col2" colwidth="86pt"/>
        <colspec colnum="3" colname="col3" colwidth="85pt"/>
        <colspec colnum="4" colname="col4" colwidth="147pt"/>
        <thead>
          <row>
            <entry colname="col1">column</entry>
            <entry colname="col2">type</entry>
            <entry colname="col3">references</entry>
            <entry colname="col4">description</entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry colname="col1"><codeph>parrelid</codeph></entry>
            <entry colname="col2">oid</entry>
            <entry colname="col3">pg_class.oid</entry>
            <entry colname="col4">The object identifier of the table.</entry>
          </row>
          <row>
            <entry colname="col1"><codeph>parkind</codeph></entry>
            <entry colname="col2">char</entry>
            <entry colname="col3"/>
            <entry colname="col4">The partition type - <codeph>R</codeph> for range or
                <codeph>L</codeph> for list.</entry>
          </row>
          <row>
            <entry colname="col1"><codeph>parlevel</codeph></entry>
            <entry colname="col2">smallint</entry>
            <entry colname="col3"/>
            <entry colname="col4">The partition level of this row: 0 for the top-level parent table,
              1 for the first level under the parent table, 2 for the second level, and so
              on.</entry>
          </row>
          <row>
            <entry colname="col1"><codeph>paristemplate</codeph></entry>
            <entry colname="col2">boolean</entry>
            <entry colname="col3"/>
            <entry colname="col4">Whether or not this row represents a subpartition template
              definition (true) or an actual partitioning level (false).</entry>
          </row>
          <row>
            <entry colname="col1"><codeph>parnatts</codeph></entry>
            <entry colname="col2">smallint</entry>
            <entry colname="col3"/>
            <entry colname="col4">The number of attributes that define this level.</entry>
          </row>
          <row>
            <entry colname="col1"><codeph>paratts</codeph></entry>
            <entry colname="col2">int2vector</entry>
            <entry colname="col3"/>
            <entry colname="col4">An array of the attribute numbers (as in
                <codeph>pg_attribute.attnum</codeph>) of the attributes that participate in defining
              this level.</entry>
          </row>
          <row>
            <entry colname="col1"><codeph>parclass</codeph></entry>
            <entry colname="col2">oidvector</entry>
            <entry colname="col3">pg_opclass.oid</entry>
            <entry colname="col4">The operator class identifier(s) of the partition columns.</entry>
          </row>
        </tbody>
      </tgroup>
    </table>
  </body>
</topic>
